home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Personal Computer World 2009 February
/
PCWFEB09.iso
/
Software
/
Resources
/
Burning & Media
/
GB-PVR 1.2.13
/
GBPVR10213.msi
/
Cabs.w1.cab
/
Ajax_Calls.cs372
< prev
next >
Wrap
Text File
|
2008-02-23
|
3KB
|
99 lines
using System;
using System.Collections;
using System.Diagnostics;
using System.Web.Script.Services;
using System.Web.Services;
using GBPVR.Public;
using GBPVRSchedule;
/// <summary>
/// Summary description for Ajax_Calls
/// </summary>
///
namespace gbweb.classes
{
[ScriptService]
public class Ajax_Calls : WebService
{
[WebMethod]
public string GetServerTime()
{
return DateTime.Now.ToLongTimeString().Trim();
}
[WebMethod]
public string GetReminders()
{
Settings guideParams = Global.Settings;
Schedule scheduleHelper = Global.Schedule;
ArrayList reminders = scheduleHelper.GetReminderList();
string temptitle = string.Empty;
string returnReminders = string.Empty;
string onclick = string.Empty;
string href = string.Empty;
foreach (Programme reminder in reminders)
{
TimeSpan span = reminder.getStartTime() - DateTime.Now;
int minutes = span.Minutes;
if (span.Days > 0)
{
minutes = minutes + ((span.Days * 24) * 60);
}
if (span.Hours > 0)
{
minutes = minutes + (span.Hours * 60);
}
if ((minutes <= Convert.ToInt32(guideParams.reminder) && minutes > 0) || (minutes == 0 && span.Seconds < -30))
{
href = "Details.aspx?id=" + reminder.getOID();
ScheduledRecording checkSchedule = scheduleHelper.GetScheduledRecordingByOID(reminder.getOID());
if ( checkSchedule != null)
{
href += "&rid=" + reminder.getOID();
}
onclick = " onclick=\"EditPop5(this.href,'Add2');return false;\"";
temptitle += "<span class=\"timeHighlight\">" + reminder.getStartTime().ToShortDateString() + " " + reminder.getStartTime().ToShortTimeString() + "</span> " +
reminder.getTitle();
temptitle = "<a href=\"" + href + "\"" + onclick + ">" + temptitle + "</a><br>";
returnReminders += temptitle;
temptitle = string.Empty;
}
}
if (returnReminders != string.Empty)
{
reminders.Clear();
reminders.TrimToSize();
return returnReminders;
}
else
{
reminders.Clear();
reminders.TrimToSize();
return "";
}
}
[WebMethod]
public string GetStreamerStatus()
{
string streamActive = "";
//Check processes running on the seerver. If VLC is running assuming streaming is active
try
{
foreach (Process thisproc in Process.GetProcessesByName("vlc"))
{
streamActive = "true";
continue;
}
}
catch (Exception Exc)
{
}
return streamActive;
}
}
}